package org.grow.loginto.exception;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: xwg
 * @CreateDate: 21-6-2
 */
@RestControllerAdvice
public class ExceptionBridge {

//    @ExceptionHandler(Exception.class)
    public ResponseEntity<String> ex(Exception e){
        return new ResponseEntity<>(e.getMessage(),null,1024);
    }
    @ExceptionHandler(JulyException.class)
    public ResponseEntity<String> julyException(JulyException e){
        return new ResponseEntity<>(e.getMessage(),null,e.getCode());
    }

}
